<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>列表</title>
<link href="resources/styles/cms.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script language="javascript">
	function changeinput(id){
		var obj_id = $('#'+id);
		var idhtml = obj_id.html();
		input_str = '<input name="'+id+'" value="'+idhtml+'" onblur="javascript:blurvalue(this)" onchange="javascript:changevalue(this)"/>';
		obj_id.html(input_str);
		obj_id.attr("onclick",'');
		obj_id.find('input').focus();
	}
	
	function blurvalue(obj){
		var input_value = obj.value;
		var obj_id = $('#'+obj.name);
		obj_id.html(input_value);
		obj_id.attr("onclick",'changeinput(this.id)');
	}
	
	function changevalue(obj){
		var input_name = obj.name;
		var input_value = obj.value;
		$.get("<{$domain}>?act=area.update",{name:input_name,value:input_value},
  		function(data){
    		if(data == 2){
				alert('三位数');
			}else if(data == 3){
				alert('已存在');
			}
  		}); 
	}
	
</script>

<style type="text/css">
body {
	background-image: url(resources/images/tab_shadow.gif);
	background-attachment: fixed;
	background-repeat: repeat-x;
}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="search_box">
<tr><td class="search_box">&nbsp;</td></tr>
</table>

<table width="100%"  border="0" cellpadding="2" cellspacing="1" class="color-tabletrim">
  <tr> 
    <td colspan="8" class="j"><img src="resources/images/file.gif" alt="新建" width="14" height="14" border="0" align="absmiddle" />&nbsp;&nbsp;国家列表</td>
  </tr>
  <tr > 
    <td width="50" class="e">id</td>
    <td class="e">国家代码</td>
    <td class="e">国家英文名</td>
	<td class="e">国家中文名</td>
  </tr>
  <{section name=i loop=$out.data}> 
  <tr onMouseOut="javascript:this.bgColor='#FFFFFF'" bgColor="#f8f8f8"> 
    <td class="c_lick" style="height:22px;text-align:center;" ><{$out.data[i].id}></td>
    <td class="c_lick" id="code_<{$out.data[i].id}>" onclick="javascript:changeinput(this.id)"><{$out.data[i].code_num}></td>
    <td class="c_lick" ><{$out.data[i].country_en}></td>
	<td class="c_lick"><{$out.data[i].country_cn}></td>
  </tr>
  <{/section}> 
</table>
<{$out.pagestring}>
</body>
</html>
